package  
{
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.events.Event;
	import flash.text.TextField;
    import flash.text.TextFormat; 
	import flash.text.TextFieldAutoSize;
	import fl.controls.RadioButton;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author LuisOliveira
	 */
	public class Inicial extends MovieClip
	{
		public var nomePlayer:String
		public var sexoPlayer:String
		
		var textoFormat:TextFormat
		var inputNameField:TextField
		var feminino:RadioButton
		var masculino:RadioButton
		var btIniciar:MovieClip
		var bg:Background
		
		
		public function Inicial() 
		{
			GerarPopup();
			
			
			//this.addEventListener(Event.ENTER_FRAME, atualizar)
			this.addEventListener(Event.ADDED_TO_STAGE, iniciarStage)

		}
		
		public function iniciarStage(e:Event):void
		{
			bg.x = stage.stageWidth / 2;
			bg.y = stage.stageHeight / 2;
			inputNameField.x = 425;
			inputNameField.y = 240;
			feminino.move(stage.stageWidth / 2-100, stage.stageHeight / 2-5);
			masculino.move(stage.stageWidth / 2+55, stage.stageHeight / 2-5);
			btIniciar.x = 650;
			btIniciar.y = 450;
		}
		
		
		
		public function GerarPopup():void
		{
			//Adciona BackGround
			bg = new Background;
			addChild(bg);
			
			// Formataçãodo texto
			textoFormat = new TextFormat()
			textoFormat.color = 0x006600
			textoFormat.size = 30
			textoFormat.font = "VAGRounded BT"
			
			// Incluindo o campo de texto
			inputNameField = new TextField()
			addChild(inputNameField);
			inputNameField.border = true;
			inputNameField.width = 230;
			inputNameField.height = 31;
			inputNameField.maxChars = 15;
			inputNameField.type = "input";	
			// Epecificando que o inputNameField terá a formatação do textoFormat
			inputNameField.defaultTextFormat = textoFormat
			
			//Criando Radio button
			feminino = new RadioButton();
			addChild(feminino);
			feminino.label=" ";
			feminino.groupName = "radioSexo";
			
			masculino = new RadioButton();
			addChild(masculino);
			masculino.label=" ";
			masculino.groupName="radioSexo";
			
			//Criando botão Iniciar
			btIniciar = new BT_Iniciar();
			addChild(btIniciar);
			
			
			
		}
	}

}